const resultJson = {
    success(data={}){
        return {
            code:200,
            msg:"success",
            data
        }
    },
    error(msg="error",code=500){
        return {
            code,
            msg
        }
    },
    check(affectedRows=0){
        return affectedRows>0?this.success():this.error("操作失败！");
    },
    page(count=0,data=[]){
        return {
            code :0,
            msg:"暂无数据",
            count,data
        }
    }
}

module.exports = resultJson
